#定义类方法
class Test:
    @classmethod
    def use_classmet(cls):
        print("我是类方法")

#调用类方法
test = Test()
test.use_classmet()
test.use_classmet()

#修改类属性
class Apple:
    count = 0
    @classmethod
    def add_two(cls):
        cls.count = 2

print(Apple.count)
Apple.add_two()
print(Apple.count)

#静态方法
class Example:
    num = 10
    @staticmethod
    def static_method():
        print(f"类属性的值为:{Example.num}")
        print("---静态方法")

example = Example()
example.static_method()
Example.static_method()
